//log using "C:\Users\mjoshi2\Box\2023 Research\NEPAL RESEARCH\Nepal Women's Economic Rights\2024\2024-01-07Analysis.smcl", replace
set seed 122574

//Table 1 - predicting the female contestant in 2008 CA election
//Model 1
poisson fptp_no_femcandiates2008  ln_mj_total_victims income_outside_nepal_per income_outside_district_per per_noholding_10_pa		///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
estat gof
test
vif, uncen
est store poisson1
margins, at(ln_mj_total_victims=(0(1)7))
marginsplot
//graph save Graph "C:\Users\mjoshi2\Box\2023 Research\NEPAL RESEARCH\Nepal Women's Economic Rights\2024\Fig 1. Total Vic_Wom_cand.gph", replace
//Model 2
poisson fptp_no_femcandiates2008 ln_male_killed ln_female_killed income_outside_nepal_per income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
estat gof
test
vif, uncen
est store poisson2
margins, at(ln_female_killed=(0(1)5))
marginsplot 
//graph save Graph "C:\Users\mjoshi2\Box\2023 Research\NEPAL RESEARCH\Nepal Women's Economic Rights\2024\Fig 2.Wom_Killed_Wom_cand.gph", replace

//Model 3
poisson fptp_no_femcandiates2008 ln_state_women_mj income_outside_nepal_per income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
estat gof
test
vif, uncen
est store poisson3

//Model 4
poisson fptp_no_femcandiates2008 ln_maoist_women_mj income_outside_nepal_per income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
estat gof
test
vif, uncen
est store poisson4


//Table 2 2011 & 2021
//Model 1
glm fem_land_own_change01_11_1000 fptp_no_femcandiates2008  ln_mj_total_victims income_outside_nepal_per income_outside_district_per 	///
per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
margins, at(fptp_no_femcandiates2008=(1(5)61))
marginsplot
//graph save Graph "C:\Users\mjoshi2\Box\2023 Research\NEPAL RESEARCH\Nepal Women's Economic Rights\2024\Fig 3.Women_candidate_changeland_01-11.gph", replace
vif, uncen
test

//Model 2
glm fem_land_own_change01_11_1000 fptp_no_femcandiates2008 ln_male_killed ln_female_killed income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
vif, uncen
test
//Model 3
glm fem_land_own_change01_11_1000 fptp_no_femcandiates2008 ln_state_women_mj income_outside_nepal_per 	///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
vif, uncen
test
//Model 4
glm fem_land_own_change01_11_1000 fptp_no_femcandiates2008 ln_maoist_women_mj income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
vif, uncen
test
//Model 5
glm fem_land_own_01change21_1000 fptp_no_femcandiates2008  ln_mj_total_victims income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

margins, at(fptp_no_femcandiates2008=(1(5)61))
marginsplot
//graph save Graph "C:\Users\mjoshi2\Box\2023 Research\NEPAL RESEARCH\Nepal Women's Economic Rights\2024\Fig 3.Women_candidate_changeland_11-21.gph", replace
vif, uncen
test
//Model 6
glm fem_land_own_01change21_1000 fptp_no_femcandiates2008 ln_male_killed ln_female_killed income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
vif, uncen
test
//Model 7
glm fem_land_own_01change21_1000 fptp_no_femcandiates2008 ln_state_women_mj income_outside_nepal_per income_outside_district_per ///
per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
vif, uncen
test
//Model 8
glm fem_land_own_01change21_1000 fptp_no_femcandiates2008 ln_maoist_women_mj income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
margins, at(fptp_no_femcandiates2008=(1(5)61))
marginsplot
vif, uncen
test

//Appandix Files
//Table 1 Descriptive Stat
sum fptp_no_femcandiates2008 fem_land_own_change01_11_1000	fem_land_own_01change21_1000  ln_mj_total_victims 	///
ln_male_killed ln_female_killed ln_state_women_mj ln_maoist_women_mj income_outside_nepal_per	 income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east region_mid region_midwest region_farwest hill tarai no_candidates_2008 if sn!=.

corr fptp_no_femcandiates2008 fem_land_own_change01_11_1000	fem_land_own_01change21_1000  ln_mj_total_victims 	///
ln_male_killed ln_female_killed ln_state_women_mj ln_maoist_women_mj income_outside_nepal_per	 income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east region_mid region_midwest region_farwest hill tarai no_candidates_2008 if sn!=.

graph matrix fptp_no_femcandiates2008 fem_land_own_change01_11_1000	fem_land_own_01change21_1000  ln_mj_total_victims 	///
ln_male_killed ln_female_killed ln_state_women_mj ln_maoist_women_mj income_outside_nepal_per	 income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east region_mid region_midwest region_farwest hill tarai no_candidates_2008 if sn!=., half

//Table 2 - Replicates Table 1 with NBREG
nbreg fptp_no_femcandiates2008  ln_mj_total_victims income_outside_nepal_per income_outside_district_per per_noholding_10_pa		///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
est store nbreg1

nbreg fptp_no_femcandiates2008 ln_male_killed ln_female_killed income_outside_nepal_per income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
est store nbreg2

nbreg fptp_no_femcandiates2008 ln_state_women_mj income_outside_nepal_per income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
est store nbreg3

nbreg fptp_no_femcandiates2008 ln_maoist_women_mj income_outside_nepal_per income_outside_district_per per_noholding_10_pa	///
religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)
est store nbreg4


**Appendix Table 3
**Test Poisson vs binomial
lrtest poisson1 nbreg1, stats force
lrtest poisson2 nbreg2, stats force
lrtest poisson3 nbreg3, stats force
lrtest poisson4 nbreg4, stats force



//Table 4 2011 & 2021
//Model 1
reg fem_land_own_change01_11_1000 fptp_no_femcandiates2008  ln_mj_total_victims income_outside_nepal_per income_outside_district_per /// 
per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008 
hettest

reg fem_land_own_change01_11_1000 fptp_no_femcandiates2008  ln_mj_total_victims income_outside_nepal_per income_outside_district_per /// 
per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

//Model 2
reg fem_land_own_change01_11_1000 fptp_no_femcandiates2008 ln_male_killed ln_female_killed income_outside_nepal_per 	///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

//Model 3
reg fem_land_own_change01_11_1000 fptp_no_femcandiates2008 ln_state_women_mj income_outside_nepal_per 	///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

//Model 4
reg fem_land_own_change01_11_1000 fptp_no_femcandiates2008 ln_maoist_women_mj income_outside_nepal_per	///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)


//Model 5
reg fem_land_own_01change21_1000 fptp_no_femcandiates2008  ln_mj_total_victims  ///
income_outside_nepal_per income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008 
hettest

reg fem_land_own_01change21_1000 fptp_no_femcandiates2008  ln_mj_total_victims  ///
income_outside_nepal_per income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

//Model 6
reg fem_land_own_01change21_1000 fptp_no_femcandiates2008 ln_male_killed ln_female_killed income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

//Model 7 
reg fem_land_own_01change21_1000 fptp_no_femcandiates2008 ln_state_women_mj income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

//Model 8
reg fem_land_own_01change21_1000 fptp_no_femcandiates2008 ln_maoist_women_mj income_outside_nepal_per ///
income_outside_district_per per_noholding_10_pa religious_fract female_lit_rate2001 region_east ///
region_mid region_midwest region_farwest hill tarai no_candidates_2008, vce(robust)

twoway histogram fem_land_own_change01_11_1000, color(*.5) || kdensity fem_land_own_change01_11_1000 || normal fem_land_own_change01_11_1000
twoway histogram fem_land_own_01change21_1000, color(*.5) || kdensity fem_land_own_01change21_1000 || normal fem_land_own_01change21_1000
twoway histogram fptp_no_femcandiates2008, color(*.5) || kdensity fptp_no_femcandiates2008|| normal fptp_no_femcandiates2008

log close
